
import {getConfigKey} from "@/api/system/config"
/*
*
* 获取支持的期权类型列表
*
* */
 async  function getEnvironment() {
  return new Promise(resolve => {
    getConfigKey("cemt").then((res) => {
      resolve(res.msg)
    })
  })

}
export default {
  mounted(el, binding, vnode) {
      const { value } = binding
      getEnvironment().then(res=>{
          if (value && value instanceof Array && value.length > 0) {
              const hasPermissions = res != null && value.includes(res)
              if (!hasPermissions) {
                  el.parentNode && el.parentNode.removeChild(el)
              }
          } else {
              throw new Error(`请设置操作权限标签值`)
          }
      });

  }
}
